<template>
	<view class="content">
		<image src="/static/bg.png" mode="" class="box-bg"></image>
		<navBack />
			<view class="card">
				<view class="_title_" style="margin-bottom: 10rpx;">
					房产信息
				</view>
				<view class="lable">
					<view class="">
						行政区域
					</view>
					<view class="">
						{{houseData.regionName||''}}
					</view>
				</view>
				<view class="lable">
					<view class="">
						物业小区	
					</view>
					<view class="">
						{{houseData.communityName||''}}
					</view>
				</view>
				<view class="lable">
					<view class="">
						楼栋
					</view>
					<view class="">
						{{houseData.buildingName||''}}
					</view>
				</view>
				<view class="lable">
					<view class="">
						单元
					</view>
					<view class="">
						{{houseData.unit||''}}
					</view>
				</view>
				<view class="lable">
					<view class="">
						楼层
					</view>
					<view class="">
						{{houseData.floor||''}}
					</view>
				</view>
				<view class="lable">
					<view class="">
						房号
					</view>
					<view class="">
						{{houseData.name||''}}
					</view>
				</view>
				<view class="lable">
					<view class="">
						面积
					</view>
					<view class="">
						{{houseData.builtupArea||''}}
					</view>
				</view>
				<view class="lable">
					<view class="">
						房屋类型
					</view>
					<view class="">
						{{housePropertyObj[houseData.houseProperty]||''}}
					</view>
				</view>
				<view class="lable">
					<view class="">
						房屋结构
					</view>
					<view class="">
						{{houseStructure[houseData.houseStructure]||''}}
					</view>
				</view>
				<view class="lable">
					<view class="">
						缴费标准
					</view>
					<view class="">
						{{houseData.paymentStandard||''}}
					</view>
				</view>
				<view class="lable">
					<view class="">
						地址
					</view>
					<view class="">
						{{houseData.position||''}}
					</view>
				</view>
			</view>
			
			<view class="card">
				<view class="_title_" style="margin-bottom: 30rpx;">
					维修资金账户信息
				</view>
				<view class="look-btn" @click="navHouseAccounts(houseData.account.id)">
					查看
				</view>
				<view class="lable">
					<view class="">
						业主
					</view>
					<view class="">
						{{houseData.account.houseProprietors}}
					</view>
				</view>	
				<view class="lable">
					<view class="">
						本金
					</view>
					<view class="money">
						￥{{houseData.account.principal}}
					</view>
				</view>
				
				<view class="lable">
					<view class="">
						利息
					</view>
					<view class="money">
						￥{{houseData.account.interest}}
					</view>
				</view>
			</view>
			
			<view class="card" v-if="houseData.isPayment">
				<view class="record-item" v-for="item in recordList" @click="navPtah(item)">
					<view class="">
						{{item.name}}
					</view>
					<view class="">
						查看
					</view>
				</view>
			</view>
			
			<view class="pay-btn" v-else>
				缴费
			</view>	

		<Loading/>
	
	
	</view>
</template>

<script>
	export default {
		data() {
			return {
				houseData:{},
				recordList:[{
					name:'收据',
					path:'receiptsList'
				},{
					name:'支付记录',
					path:'paymentHistory'
				},{
					name:'缴费记录',
					path:'paymentRecord'
				},{
					name:'结息记录', 
					path:'interestRecord'
				},{ 
					name:'维修记录',
					path:'projects' 
				},{
					name:'投票记录',
					path:'pollResult'
				},{
					name:'清算记录',
					path:'liquidationRecords'
				}],
				housePropertyObj:{
					Residence: '住宅',
					Business: '商业',
					Villa: '别墅',
					Office: '办公/写字楼',
					ResidenceAndBusiness: '商住',
					Storage: '仓储',
					Garage: '车库/车位',
					PublicEstablishments: '公共配套用房',
					PropertyHouse: '物业用房',
					Other: '其他'
				},
				houseStructure:{
					HighFrame: '高层框架',
					MultiStoryFrame: '多层框架',
					MultiStoryBrickMasonry: '多层砖混',
					Other: '其他'
				}
			}
		},
		onLoad(e) {
			this.$myRequest(`/api/houses/GetHouseInProjectProcess/${e.id}`).then(res=>{
				this.houseData=res
			})
		},
		methods: {
			navPtah(item){
				uni.navigateTo({
					url:`/pages/index/${item.path}/${item.path}?id=${this.houseData.id}`
				})
			},
			navHouseAccounts(id){
				uni.navigateTo({
					url:'/pages/me/houseAccounts/houseAccounts?id='+id
				})
			}
		}
	}
</script>

<style lang="scss">
	.content{
		background-color: #f5f5f5;
		padding: 172rpx 20rpx 0 20rpx;
		min-height: calc(100vh - 172rpx);
	}
 .card{
	 padding: 28rpx 20rpx;
	 .look-btn{
		 width: 170rpx;
		 height: 52rpx;
		 background-color: #456FFD;
		 font-size: 28rpx;
		 color: #ffffff;
		 line-height: 52rpx;
		 text-align: center;border-radius: 52rpx;
		 position: absolute;
		 top: 22rpx;
		 right: 20rpx;
	 }
	 .record-item{
		 display: flex;
		 justify-content: space-between;
		 font-size: 28rpx;
		 color: #666666;
		 padding: 16rpx 0;
		 
		 view:nth-child(2){
			 color: #456FFD;
			 font-weight: 700;
		 }
	 }
 }
 .pay-btn{
 		 width: 310rpx;
 		 height: 74rpx;
 		 line-height: 74rpx;
 		 color: #ffffff;
 		 background-color: #456FFD;
 		 border-radius: 37rpx;
 		 text-align: center;
 		 margin: 60rpx auto;
 		 font-size: 28rpx;
 }
</style>
